$(document).ready(function() {
	console.log("sucess");
	var a = $("#test").val();
	console.log(a);
	$("#login").validate({
		onsubmit:true,
		rules:{
			userid:"required",
			password:"required"
		},
		messages:{
			userid:"请输入账号",
			password:"请输入密码"
		},
		submitHandler:function(form){
			var userid = $("#userid").val();
			var password = $("#password").val();
			$.ajax({
				type:'post',
				url:'login.do',
				data:{"userid":userid,"password":password},
				success:function(data){
					if("illegal"==data){
						alert("用户名或密码不真确");
					}else{
						window.location.href=data+"/page.do?pagename=main";
					}
				}
			});
		},
		invalidHandler: function(form, validator) {return false;}
	})
});